//
//  AppDelegate.m
//  CreditManger
//
//  Created by sky on 15/10/13.
//  Copyright © 2015年 jinxin. All rights reserved.
//

#import "AppDelegate.h"
#import "AppDelegate+NotificationCenter.h"
#import "UIWindow+Extension.h"
#import "CustomLunchView.h"
#import "UMSocial.h"
#import "UMSocialWechatHandler.h"
#import "UMSocialQQHandler.h"


@interface AppDelegate ()
<UIAlertViewDelegate>

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [application setStatusBarStyle:UIStatusBarStyleLightContent];

    [HBLoginManager getCurrentUserFromUserdefault];
    [self registerUMAnalytics];
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.window switchRootViewController];
    [self.window makeKeyAndVisible];
    
    
//    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//    HBNavigationController *nav = [[HBNavigationController alloc]initWithRootViewController:[[HBSettingCtrl alloc]init]];
//    self.window.rootViewController = nav;
//    [self.window makeKeyAndVisible];
    
    [self notifyApplication:application didFinishLaunchingWithOptions:launchOptions];
    
    CustomLunchView* lunchAni = [[CustomLunchView alloc] init];
    [lunchAni showLanchView];
    lunchAni.animationFinished = ^(BOOL isFinished){
        if (isFinished == YES) {
            

        }
    };

    return YES;
}


- (void)registerUMAnalytics
{
    //    [MobClick setCrashReportEnabled:NO]; // 如果不需要捕捉异常，注释掉此行
    
    
    [UMSocialData setAppKey:@"566a6335e0f55a5892001438"];
    [UMSocialWechatHandler setWXAppId:@"wx64d3267b8c60679e" appSecret:@"591beec8265694ecd4661177497d81ed" url:@"http://www.jinxin99.cn/"];
    [UMSocialQQHandler setQQWithAppId:@"1105012838" appKey:@"OY2TO43SdrXszZmV" url:@"http://www.jinxin99.cn/"];
    
    
}


- (void)applicationWillResignActive:(UIApplication *)application
{
    
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    [[NSNotificationCenter defaultCenter] postNotificationName:@"backGroud" object:nil];
   
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    
}


@end
